Skip to content

test_copy_from_propagate_error fails with Python 3.5 #412

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
desiderius opened this issue Feb 25, 2016 · 3 comments
Closed

test_copy_from_propagate_error fails with Python 3.5 #412

desiderius opened this issue Feb 25, 2016 · 3 comments
Milestone

Comments

@desiderius
Copy link

Hello, I am trying to update the package of psycopg2 (from the source on PyPI) on NixOS/Linux but the following unit test fails with Python 3.5.1:

======================================================================
FAIL: test_copy_from_propagate_error (psycopg2.tests.test_copy.CopyTests)
----------------------------------------------------------------------
ZeroDivisionError: division by zero

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/nix/store/mdwpl1s8iwpj06r5zvva3bfhr7lswwfp-python3.5-psycopg2-2.6.1/lib/python3.5/site-packages/psycopg2/tests/test_copy.py", line 356, in test_copy_from_propagate_error
    curs.copy_from(BrokenRead(), "tcopy")
SystemError: <class 'psycopg2.extensions.QueryCanceledError'> returned a result with an error set

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/nix/store/mdwpl1s8iwpj06r5zvva3bfhr7lswwfp-python3.5-psycopg2-2.6.1/lib/python3.5/site-packages/psycopg2/tests/testutils.py", line 291, in skip_if_green__
    return f(self)
  File "/nix/store/mdwpl1s8iwpj06r5zvva3bfhr7lswwfp-python3.5-psycopg2-2.6.1/lib/python3.5/site-packages/psycopg2/tests/test_copy.py", line 358, in test_copy_from_propagate_error
    self.assertTrue('ZeroDivisionError' in str(e))
AssertionError: False is not true

----------------------------------------------------------------------
Ran 501 tests in 18.250s

FAILED (failures=1, skipped=53)

I would like to confirm whether this is an expected error (in the current state of the sources on PyPi) or a mistake in my packaging.

@dvarrazzo
Copy link
Member

We haven't tested psycopg with python 3.5 yet.

desiderius pushed a commit to desiderius/nixpkgs that referenced this issue Mar 2, 2016
The unit tests are disabled because they require a local instance
of PostgreSQL.

All unit tests pass in my local instance for
  - Python 2.7
  - Python 3.4

One test fails for Python 3.5 (not officialy supported anyway):
  - test_copy_from_propagate_error (psycopg2.tests.test_copy.CopyTests)
    ZeroDivisionError: division by zero

This issue is reported upstream:
psycopg/psycopg2#412
@desiderius
Copy link
Author

Thank you for the feedback, can I help with the test with Python 3.5 in a way ?

@dvarrazzo dvarrazzo modified the milestone: psycopg 2.6.2 Mar 5, 2016
dvarrazzo added a commit to dvarrazzo/psycopg2 that referenced this issue Mar 8, 2016
@dvarrazzo
Copy link
Member

Fixed, to be released in 2.6.2

dvarrazzo added a commit that referenced this issue Mar 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants